﻿using MelonLoader;
using System;
using System.Reflection;

namespace MOD_TaiYangQiu.common
{
    public static class LogUtil
    {
        private static object logMethod;
        private static MethodInfo methodInfo;
        public static void Init()
        {
            Type type = typeof(MelonLogger);
            methodInfo = type.GetMethod("NativeMsg", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
            logMethod = Activator.CreateInstance(type);
        }
        public static void Log(string mould, string text)
        {
            object[] args = new object[] { ConsoleColor.Red, ConsoleColor.Green, mould, text };
            methodInfo.Invoke(logMethod, args);
        }
    }
}
